* Produce Figure 1 in Appendix B - Unemployement rate in Europe  
	
	** prep dataset TOTAL 
	
	clear all	
	cd "${data}"
	import excel "unemployment_total.xlsx", sheet("Sheet1")

	nrow
	ren _* yr*
	drop yr

	encode country, gen(contry_code)
	reshape long yr, i(contry_code) j(year) string
	ren yr rate
	gen date = date(year, "YM")
	format date %td
	gen unemploymenttotal = real(rate)
	drop rate
	save unemployment_total.dta, replace


	** prep dataset LESS THAN 25


	clear all	
	cd "${data}"
	import excel "unemployment_less25.xlsx", sheet("Sheet1")

	nrow
	ren _* yr*
	keep country yr19* yr20*
	encode country, gen(contry_code)
	reshape long yr, i(contry_code) j(year) string
	ren yr rate
	gen date = date(year, "YM")
	format date %td
	gen unemployment25 = real(rate)
	drop rate
	save unemployment_less25.dta, replace


	** prep dataset BETWEEN 25 TO 74

	clear all	
	cd "${data}"	
	import excel "unemployment_25_74.xlsx", sheet("Sheet1")

	nrow
	ren _* yr*
	keep country yr19* yr20*

	encode country, gen(contry_code)
	reshape long yr, i(contry_code) j(year) string
	ren yr rate
	gen date = date(year, "YM")
	format date %td
	gen unemployment2574 = real(rate)
	drop rate
	save unemployment_2574.dta, replace


		*** merge

	clear all	
	cd "${data}"
	
	use unemployment_total, clear
	
	merge 1:1 country date using unemployment_less25
	
	keep if _merge==3
	drop _merge
	
	merge 1:1 country date using unemployment_2574
	
	keep if _merge==3
	drop _merge

	drop if country=="United States"
	
	*******************************************************************
	
	collapse unemploymenttotal unemployment25 unemployment2574, by(date) 
	
	gen diff = unemployment25- unemployment2574  if unemployment25!=. & unemployment2574!=.
	
	label var unemployment25 "Unemployement: less than 25"
	label var unemployment2574 "Unemployement: 25-74 years old"
	
	graph set window fontface "Arial Narrow"
	
	twoway line unemployment25 date || line unemployment2574 date, legend(position(6) row(1)) scheme(plottig) plotregion(color(white)) ///
	ytitle("Unemployment rate") xtitle("") yscale(r(0(5)25)) yl(0(5)25) ///
	graphregion(color(white)) plotregion(lcolor(black) lwidth(medthin)) 
	
	graph export ${figures}/appendixB.pdf,  replace
	
	
